<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"


      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:h="http://xmlns.jcp.org/jsf/html">

    <ui:composition template="template.xhtml">
        <ui:define name="content">
            <p:panel>
                <p:dataTable id="datalist" value="#{productosController.itemsProductos}" var="item" 
                             paginator="true"
                             rows="10"
                             rowsPerPageTemplate="10,30,50" >
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Codigo"/>
                            </f:facet>
                            <h:outputText value="#{item.ASIN}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Descripcion"/>
                            </f:facet>
                            <h:outputText value="#{item.title}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Similar"/>
                            </f:facet>
                            <p:commandButton actionListener="#{productosController.similar(item)}" 
                                             update=":notificacion"
                                             oncomplete="PF('bar').show()"
                                             icon="ui-icon-arrow-1-s"/>
                            
                        </p:column>
                        <f:facet name="footer">
                            <p:commandButton actionListener="#{productosController.setSelected(null)}"
                                oncomplete="PF('bar').hide()"  icon="ui-icon-arrow-1-n"/>
                            <p:selectOneMenu id="categoria" value="#{productosController.group}" 
                                             >
                                <f:selectItems value="#{productosController.listGroup}"
                                               var="usuarioItem"
                                               itemValue="#{usuarioItem}"/>
                            </p:selectOneMenu>
                        </f:facet>
                    </p:dataTable>
            </p:panel>
                        
        </ui:define>
    </ui:composition>

</html>
